/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.36
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


using System;
using System.Runtime.InteropServices;

public class matrix3x3 : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal matrix3x3(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(matrix3x3 obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~matrix3x3() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        openbabelPINVOKE.delete_matrix3x3(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
    }
  }

  public matrix3x3() : this(openbabelPINVOKE.new_matrix3x3__SWIG_0(), true) {
  }

  public matrix3x3(double s) : this(openbabelPINVOKE.new_matrix3x3__SWIG_1(s), true) {
  }

  public matrix3x3(vector3 row1, vector3 row2, vector3 row3) : this(openbabelPINVOKE.new_matrix3x3__SWIG_2(vector3.getCPtr(row1), vector3.getCPtr(row2), vector3.getCPtr(row3)), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public matrix3x3(SWIGTYPE_p_a_3__double d) : this(openbabelPINVOKE.new_matrix3x3__SWIG_3(SWIGTYPE_p_a_3__double.getCPtr(d)), true) {
  }

  public void GetArray(SWIGTYPE_p_double m) {
    openbabelPINVOKE.matrix3x3_GetArray(swigCPtr, SWIGTYPE_p_double.getCPtr(m));
  }

  public matrix3x3 inverse() {
    matrix3x3 ret = new matrix3x3(openbabelPINVOKE.matrix3x3_inverse(swigCPtr), true);
    return ret;
  }

  public matrix3x3 transpose() {
    matrix3x3 ret = new matrix3x3(openbabelPINVOKE.matrix3x3_transpose(swigCPtr), true);
    return ret;
  }

  public void randomRotation(OBRandom rnd) {
    openbabelPINVOKE.matrix3x3_randomRotation(swigCPtr, OBRandom.getCPtr(rnd));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public double determinant() {
    double ret = openbabelPINVOKE.matrix3x3_determinant(swigCPtr);
    return ret;
  }

  public bool isSymmetric() {
    bool ret = openbabelPINVOKE.matrix3x3_isSymmetric(swigCPtr);
    return ret;
  }

  public bool isOrthogonal() {
    bool ret = openbabelPINVOKE.matrix3x3_isOrthogonal(swigCPtr);
    return ret;
  }

  public bool isDiagonal() {
    bool ret = openbabelPINVOKE.matrix3x3_isDiagonal(swigCPtr);
    return ret;
  }

  public bool isUnitMatrix() {
    bool ret = openbabelPINVOKE.matrix3x3_isUnitMatrix(swigCPtr);
    return ret;
  }

  public double Get(int row, int column) {
    double ret = openbabelPINVOKE.matrix3x3_Get(swigCPtr, row, column);
    return ret;
  }

  public void Set(int row, int column, double v) {
    openbabelPINVOKE.matrix3x3_Set(swigCPtr, row, column, v);
  }

  public void SetColumn(int column, vector3 v) {
    openbabelPINVOKE.matrix3x3_SetColumn(swigCPtr, column, vector3.getCPtr(v));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetRow(int row, vector3 v) {
    openbabelPINVOKE.matrix3x3_SetRow(swigCPtr, row, vector3.getCPtr(v));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public vector3 GetColumn(uint col) {
    vector3 ret = new vector3(openbabelPINVOKE.matrix3x3_GetColumn(swigCPtr, col), true);
    return ret;
  }

  public vector3 GetRow(uint row) {
    vector3 ret = new vector3(openbabelPINVOKE.matrix3x3_GetRow(swigCPtr, row), true);
    return ret;
  }

  public void SetupRotMat(double x, double y, double z) {
    openbabelPINVOKE.matrix3x3_SetupRotMat(swigCPtr, x, y, z);
  }

  public void PlaneReflection(vector3 norm) {
    openbabelPINVOKE.matrix3x3_PlaneReflection(swigCPtr, vector3.getCPtr(norm));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void RotAboutAxisByAngle(vector3 axis, double angle) {
    openbabelPINVOKE.matrix3x3_RotAboutAxisByAngle(swigCPtr, vector3.getCPtr(axis), angle);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void FillOrth(double alpha, double beta, double gamma, double a, double b, double c) {
    openbabelPINVOKE.matrix3x3_FillOrth(swigCPtr, alpha, beta, gamma, a, b, c);
  }

  public matrix3x3 findEigenvectorsIfSymmetric(vector3 eigenvals) {
    matrix3x3 ret = new matrix3x3(openbabelPINVOKE.matrix3x3_findEigenvectorsIfSymmetric(swigCPtr, vector3.getCPtr(eigenvals)), true);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void jacobi(uint n, SWIGTYPE_p_double a, SWIGTYPE_p_double d, SWIGTYPE_p_double v) {
    openbabelPINVOKE.matrix3x3_jacobi(n, SWIGTYPE_p_double.getCPtr(a), SWIGTYPE_p_double.getCPtr(d), SWIGTYPE_p_double.getCPtr(v));
  }

}
