#include <opennurbs_matrix.h>
Public Member Functions | |
| ON_Matrix () | |
| ON_Matrix (int row_count, int col_count) | |
| ON_Matrix (int, int, int, int) | |
| ON_Matrix (const ON_Xform &) | |
| ON_Matrix (const ON_Matrix &) | |
| ON_Matrix (int row_count, int col_count, double **M, bool bDestructorFreeM) | |
| This constructor is for experts who have storage for a matrix and need to use it in ON_Matrix form. More... | |
| virtual | ~ON_Matrix () |
| bool | Add (const ON_Matrix &A, const ON_Matrix &B) |
| Set this = A+B. More... | |
| bool | BackSolve (double, int, const double *, double *) const |
| Solve M*X=B where M is upper triangular with a unit diagonal and B is a column of values. More... | |
| bool | BackSolve (double, int, const ON_3dPoint *, ON_3dPoint *) const |
| Solve M*X=B where M is upper triangular with a unit diagonal and B is a column of 3d points. More... | |
| bool | BackSolve (double, int, int, int, const double *, int, double *) const |
| Solve M*X=B where M is upper triangular with a unit diagonal and B is a column of points More... | |
| int | ColCount () const |
| void | ColOp (int, double, int) |
| void | ColScale (int, double) |
| bool | Create (int, int) |
| bool | Create (int, int, int, int) |
| bool | Create (int row_count, int col_count, double **M, bool bDestructorFreeM) |
| This constructor is for experts who have storage for a matrix and need to use it in ON_Matrix form. More... | |
| void | Destroy () |
| void | EmergencyDestroy () |
| bool | Invert (double) |
| bool | IsColOrthoganal () const |
| bool | IsColOrthoNormal () const |
| bool | IsRowOrthoganal () const |
| bool | IsRowOrthoNormal () const |
| int | IsSquare () const |
| bool | IsValid () const |
| int | MaxCount () const |
| int | MinCount () const |
| bool | Multiply (const ON_Matrix &A, const ON_Matrix &B) |
| Set this = A*B. More... | |
| ON_Matrix & | operator= (const ON_Matrix &) |
| ON_Matrix & | operator= (const ON_Xform &) |
| double * | operator[] (int) |
| const double * | operator[] (int) const |
| int | RowCount () const |
| void | RowOp (int, double, int) |
| int | RowReduce (double, double &, double &) |
| Row reduce a matrix to calculate rank and determinant. More... | |
| int | RowReduce (double, double *, double *=nullptr) |
| Row reduce a matrix as the first step in solving M*X=B where B is a column of values. More... | |
| int | RowReduce (double, ON_3dPoint *, double *=nullptr) |
| Row reduce a matrix as the first step in solving M*X=B where B is a column of 3d points More... | |
| int | RowReduce (double, int, int, double *, double *=nullptr) |
| Row reduce a matrix as the first step in solving M*X=B where B is a column arbitrary dimension points. More... | |
| void | RowScale (int, double) |
| bool | Scale (double s) |
| Set this = s*this. More... | |
| void | SetDiagonal (double) |
| void | SetDiagonal (const double *) |
| void | SetDiagonal (int, const double *) |
| void | SetDiagonal (const ON_SimpleArray< double > &) |
| bool | SwapCols (int, int) |
| bool | SwapRows (int, int) |
| bool | Transpose () |
| unsigned int | UnsignedColCount () const |
| unsigned int | UnsignedMaxCount () const |
| unsigned int | UnsignedMinCount () const |
| unsigned int | UnsignedRowCount () const |
| void | Zero () |
Static Public Member Functions | |
| static double ** | Allocate (unsigned int row_count, unsigned int col_count) |
| static void | Deallocate (double **M) |
Public Attributes | |
| double ** | m = nullptr |
| ON_Matrix::ON_Matrix | ( | ) |
| ON_Matrix::ON_Matrix | ( | int | row_count, |
| int | col_count | ||
| ) |
| ON_Matrix::ON_Matrix | ( | int | , |
| int | , | ||
| int | , | ||
| int | |||
| ) |
| ON_Matrix::ON_Matrix | ( | const ON_Xform & | ) |
| ON_Matrix::ON_Matrix | ( | const ON_Matrix & | ) |
| ON_Matrix::ON_Matrix | ( | int | row_count, |
| int | col_count, | ||
| double ** | M, | ||
| bool | bDestructorFreeM | ||
| ) |
This constructor is for experts who have storage for a matrix and need to use it in ON_Matrix form.
| row_count | [in] |
| col_count | [in] |
| M | [in] |
| bDestructorFreeM | [in] If true, ~ON_Matrix will call onfree(M). If false, caller is managing M's memory. |
ON_Matrix functions that increase the value of row_count or col_count will fail on a matrix created with this constructor.
|
virtual |
Set this = A+B.
| A | [in] (Can be this) |
| B | [in] (Can be this) |
|
static |
| bool ON_Matrix::BackSolve | ( | double | , |
| int | , | ||
| const double * | , | ||
| double * | |||
| ) | const |
Solve M*X=B where M is upper triangular with a unit diagonal and B is a column of values.
| zero_tolerance | in used to test for "zero" values in B in under determined systems of equations. |
| Bsize | [in] (>=m_row_count) length of B. The values in B[m_row_count],...,B[Bsize-1] are tested to make sure they are "zero". |
| B | [in] array of length Bsize. |
| X | [out] array of length m_col_count. Solutions returned here. |
Actual values M[i][j] with i <= j are ignored. M[i][i] is assumed to be one and M[i][j] i<j is assumed to be zero. For square M, B and X can point to the same memory.
| bool ON_Matrix::BackSolve | ( | double | , |
| int | , | ||
| const ON_3dPoint * | , | ||
| ON_3dPoint * | |||
| ) | const |
Solve M*X=B where M is upper triangular with a unit diagonal and B is a column of 3d points.
| zero_tolerance | in used to test for "zero" values in B in under determined systems of equations. |
| Bsize | [in] (>=m_row_count) length of B. The values in B[m_row_count],...,B[Bsize-1] are tested to make sure they are "zero". |
| B | [in] array of length Bsize. |
| X | [out] array of length m_col_count. Solutions returned here. |
Actual values M[i][j] with i <= j are ignored. M[i][i] is assumed to be one and M[i][j] i<j is assumed to be zero. For square M, B and X can point to the same memory.
| bool ON_Matrix::BackSolve | ( | double | , |
| int | , | ||
| int | , | ||
| int | , | ||
| const double * | , | ||
| int | , | ||
| double * | |||
| ) | const |
Solve M*X=B where M is upper triangular with a unit diagonal and B is a column of points
| zero_tolerance | in used to test for "zero" values in B in under determined systems of equations. |
| pt_dim | [in] dimension of points |
| Bsize | [in] (>=m_row_count) number of points in B[]. The points correspoinding to indices m_row_count, ..., (Bsize-1) are tested to make sure they are "zero". |
| Bpt_stride | [in] stride between B points (>=pt_dim) |
| Bpt | [in/out] array of m_row_count*Bpt_stride values. The i-th B point is (Bpt[i*Bpt_stride],...,Bpt[i*Bpt_stride+pt_dim-1]). |
| Xpt_stride | [in] stride between X points (>=pt_dim) |
| Xpt | [out] array of m_col_count*Xpt_stride values. The i-th X point is (Xpt[i*Xpt_stride],...,Xpt[i*Xpt_stride+pt_dim-1]). |
Actual values M[i][j] with i <= j are ignored. M[i][i] is assumed to be one and M[i][j] i<j is assumed to be zero. For square M, B and X can point to the same memory.
| int ON_Matrix::ColCount | ( | ) | const |
| void ON_Matrix::ColOp | ( | int | , |
| double | , | ||
| int | |||
| ) |
| void ON_Matrix::ColScale | ( | int | , |
| double | |||
| ) |
| bool ON_Matrix::Create | ( | int | , |
| int | |||
| ) |
| bool ON_Matrix::Create | ( | int | , |
| int | , | ||
| int | , | ||
| int | |||
| ) |
| bool ON_Matrix::Create | ( | int | row_count, |
| int | col_count, | ||
| double ** | M, | ||
| bool | bDestructorFreeM | ||
| ) |
This constructor is for experts who have storage for a matrix and need to use it in ON_Matrix form.
| row_count | [in] |
| col_count | [in] |
| M | [in] |
| bDestructorFreeM | [in] If true, ~ON_Matrix will call onfree(M). If false, caller is managing M's memory. |
ON_Matrix functions that increase the value of row_count or col_count will fail on a matrix created with this constructor.
|
static |
| void ON_Matrix::Destroy | ( | ) |
| void ON_Matrix::EmergencyDestroy | ( | ) |
| bool ON_Matrix::Invert | ( | double | ) |
| bool ON_Matrix::IsColOrthoganal | ( | ) | const |
| bool ON_Matrix::IsColOrthoNormal | ( | ) | const |
| bool ON_Matrix::IsRowOrthoganal | ( | ) | const |
| bool ON_Matrix::IsRowOrthoNormal | ( | ) | const |
| int ON_Matrix::IsSquare | ( | ) | const |
| bool ON_Matrix::IsValid | ( | ) | const |
| int ON_Matrix::MaxCount | ( | ) | const |
| int ON_Matrix::MinCount | ( | ) | const |
Set this = A*B.
| A | [in] (Can be this) |
| B | [in] (Can be this) |
| double* ON_Matrix::operator[] | ( | int | ) |
| const double* ON_Matrix::operator[] | ( | int | ) | const |
| int ON_Matrix::RowCount | ( | ) | const |
| void ON_Matrix::RowOp | ( | int | , |
| double | , | ||
| int | |||
| ) |
| int ON_Matrix::RowReduce | ( | double | , |
| double & | , | ||
| double & | |||
| ) |
Row reduce a matrix to calculate rank and determinant.
| zero_tolerance | in zero tolerance for pivot test If the absolute value of a pivot is <= zero_tolerance, then the pivot is assumed to be zero. |
| determinant | [out] value of determinant is returned here. |
| pivot | [out] value of the smallest pivot is returned here |
The matrix itself is row reduced so that the result is an upper triangular matrix with 1's on the diagonal.
| int ON_Matrix::RowReduce | ( | double | , |
| double * | , | ||
| double * | = nullptr |
||
| ) |
Row reduce a matrix as the first step in solving M*X=B where B is a column of values.
| zero_tolerance | in zero tolerance for pivot test If the absolute value of a pivot is <= zero_tolerance, then the pivot is assumed to be zero. |
| B | [in/out] an array of m_row_count values that is row reduced with the matrix. |
| determinant | [out] value of determinant is returned here. |
| pivot | [out] If not nullptr, then the value of the smallest pivot is returned here |
The matrix itself is row reduced so that the result is an upper triangular matrix with 1's on the diagonal.
| int ON_Matrix::RowReduce | ( | double | , |
| ON_3dPoint * | , | ||
| double * | = nullptr |
||
| ) |
Row reduce a matrix as the first step in solving M*X=B where B is a column of 3d points
| zero_tolerance | in zero tolerance for pivot test If the absolute value of a pivot is <= zero_tolerance, then the pivot is assumed to be zero. |
| B | [in/out] an array of m_row_count 3d points that is row reduced with the matrix. |
| determinant | [out] value of determinant is returned here. |
| pivot | [out] If not nullptr, then the value of the smallest pivot is returned here |
The matrix itself is row reduced so that the result is an upper triangular matrix with 1's on the diagonal.
| int ON_Matrix::RowReduce | ( | double | , |
| int | , | ||
| int | , | ||
| double * | , | ||
| double * | = nullptr |
||
| ) |
Row reduce a matrix as the first step in solving M*X=B where B is a column arbitrary dimension points.
| zero_tolerance | in zero tolerance for pivot test If a the absolute value of a pivot is <= zero_tolerance, then the pivoit is assumed to be zero. |
| pt_dim | [in] dimension of points |
| pt_stride | [in] stride between points (>=pt_dim) |
| pt | [in/out] array of m_row_count*pt_stride values. The i-th point is (pt[i*pt_stride],...,pt[i*pt_stride+pt_dim-1]). This array of points is row reduced along with the matrix. |
| pivot | [out] If not nullptr, then the value of the smallest pivot is returned here |
The matrix itself is row reduced so that the result is an upper triangular matrix with 1's on the diagonal.
| void ON_Matrix::RowScale | ( | int | , |
| double | |||
| ) |
| bool ON_Matrix::Scale | ( | double | s | ) |
Set this = s*this.
| s | [in] |
| void ON_Matrix::SetDiagonal | ( | double | ) |
| void ON_Matrix::SetDiagonal | ( | const double * | ) |
| void ON_Matrix::SetDiagonal | ( | int | , |
| const double * | |||
| ) |
| void ON_Matrix::SetDiagonal | ( | const ON_SimpleArray< double > & | ) |
| bool ON_Matrix::SwapCols | ( | int | , |
| int | |||
| ) |
| bool ON_Matrix::SwapRows | ( | int | , |
| int | |||
| ) |
| bool ON_Matrix::Transpose | ( | ) |
| unsigned int ON_Matrix::UnsignedColCount | ( | ) | const |
| unsigned int ON_Matrix::UnsignedMaxCount | ( | ) | const |
| unsigned int ON_Matrix::UnsignedMinCount | ( | ) | const |
| unsigned int ON_Matrix::UnsignedRowCount | ( | ) | const |
| void ON_Matrix::Zero | ( | ) |
| double** ON_Matrix::m = nullptr |