3ds Max C++ API Reference
BigMatrix Class Reference

#include <mnbigmat.h>

+ Inheritance diagram for BigMatrix:

Public Member Functions

 BigMatrix ()
 
DllExport BigMatrix (int mm, int nn)
 
DllExport BigMatrix (const BigMatrix &from)
 
 ~BigMatrix ()
 
DllExport void Clear ()
 
DllExport int SetSize (int mm, int nn)
 
DllExport float * operator[] (int i) const
 
DllExport BigMatrixoperator= (const BigMatrix &from)
 
DllExport void SetTranspose (BigMatrix &trans) const
 
DllExport float Invert ()
 
DllExport void Identity ()
 
DllExport void Randomize (float scale)
 
DllExport void MNDebugPrint ()
 
DllExport void dump (FILE *fp)
 

Public Attributes

int m
 
int n
 
float * val
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class Matrix3.

Description:
This class implements an m x n matrix for situations & calculations where the usual 4x3 Matrix3 class is not adequate. BigMatrix implements several useful matrix operations, including matrix multiplication and inversion, but is not guaranteed to be especially efficient. All methods are implemented by the system.
Data Members:
int m, n

The dimensions of the matrix. There are m rows and n columns.

float *val

The elements of the matrix. val[i*n+j] is the value in the i'th row and the j'th column.

Constructor & Destructor Documentation

◆ BigMatrix() [1/3]

BigMatrix ( )
inline
Remarks
Initializer. Sets m and n to zero, and val to NULL.
36 { val=NULL; m=0; n=0; }
#define NULL
Definition: autoptr.h:18
float * val
Definition: mnbigmat.h:33
int m
Definition: mnbigmat.h:32
int n
Definition: mnbigmat.h:32

◆ BigMatrix() [2/3]

DllExport BigMatrix ( int  mm,
int  nn 
)
Remarks
Initializer. Sets the dimensions of the matrix to mm by nn, and allocates space for the contents. The total size of the matrix, mm*nn, cannot exceed 10,000.

◆ BigMatrix() [3/3]

DllExport BigMatrix ( const BigMatrix from)
Remarks
Initializer. Sets this BigMatrix equal to from.

◆ ~BigMatrix()

~BigMatrix ( )
inline
Remarks
Destructor. Frees the internal arrays.
44 { Clear (); }
DllExport void Clear()

Member Function Documentation

◆ Clear()

DllExport void Clear ( )
Remarks
Frees the internal arrays and sets the matrix's size to 0x0.

◆ SetSize()

DllExport int SetSize ( int  mm,
int  nn 
)
Remarks
Sets the matrix's size to mm by nn, and allocates space for the contents.
Returns
Returns the total size of the matrix (mm * nn) or -1 if there's an error.

◆ operator[]()

DllExport float* operator[] ( int  i) const
Remarks
Returns a pointer to the i'th row in the matrix. Thus for a BigMatrix A, A[i][j] is the value in the i'th row and the j'th column.

◆ operator=()

DllExport BigMatrix& operator= ( const BigMatrix from)
Remarks
Sets this BigMatrix equal to from.

◆ SetTranspose()

DllExport void SetTranspose ( BigMatrix trans) const
Remarks
Sets trans to be the transpose of this BigMatrix.

◆ Invert()

DllExport float Invert ( )
Remarks
Inverts this matrix. Note that this only works if this matrix is "square", i.e. if m = n. This algorithm is CUBIC in the number of rows, so be careful!
Returns
The determinant of the matrix (before inversion) is returned. If the return value is 0, the matrix could not be inverted.

◆ Identity()

DllExport void Identity ( )
Remarks
If m and n are equal, this method sets this matrix to the identity. If m and n are not equal, it does nothing.

◆ Randomize()

DllExport void Randomize ( float  scale)
Remarks
Creates a random matrix for testing purposes. Reseeds the random number generator with the current system time, for a non-reproducible result. Values of the matrix are set to anything in the range (-scale, scale).

◆ MNDebugPrint()

DllExport void MNDebugPrint ( )
Remarks
This method prints the contents of the BigMatrix to the IDE debugging window using DebugPrints.

◆ dump()

DllExport void dump ( FILE *  fp)

Member Data Documentation

◆ m

int m

◆ n

int n

◆ val

float* val