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

package org.opensim.modeling;

/**
 *  This is the Matrix class intended to appear in user code. It can be a <br>
 *  fixed-size view of someone else's data, or can be a resizable data owner itself.
 */
public class MatrixRotation extends MatrixBaseRotation {
  private transient long swigCPtr;

  public MatrixRotation(long cPtr, boolean cMemoryOwn) {
    super(opensimSimbodyJNI.MatrixRotation_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(MatrixRotation obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        opensimSimbodyJNI.delete_MatrixRotation(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public MatrixRotation() {
    this(opensimSimbodyJNI.new_MatrixRotation__SWIG_0(), true);
  }

  public MatrixRotation(MatrixRotation src) {
    this(opensimSimbodyJNI.new_MatrixRotation__SWIG_1(MatrixRotation.getCPtr(src), src), true);
  }

  public MatrixRotation(int m, int n) {
    this(opensimSimbodyJNI.new_MatrixRotation__SWIG_2(m, n), true);
  }

  public MatrixRotation(int m, int n, Rotation initialValue) {
    this(opensimSimbodyJNI.new_MatrixRotation__SWIG_3(m, n, Rotation.getCPtr(initialValue), initialValue), true);
  }

  public String toString() {
    return opensimSimbodyJNI.MatrixRotation_toString(swigCPtr, this);
  }

  /**
   *  Variant of indexing operator that's scripting friendly to get entry (i, j) *
   */
  public Rotation get(int i, int j) {
    return new Rotation(opensimSimbodyJNI.MatrixRotation_get(swigCPtr, this, i, j), false);
  }

  /**
   *  Variant of indexing operator that's scripting friendly to set entry (i, j) *
   */
  public void set(int i, int j, Rotation value) {
    opensimSimbodyJNI.MatrixRotation_set(swigCPtr, this, i, j, Rotation.getCPtr(value), value);
  }

}
