|
lkptr
|
Empaque alrededor de Matrix que usa lkptr<X> para mejorar la implementación de los operadores aritméticos.
More...
#include <RefMatrix.h>
Public Types | |
| typedef E | value_type |
| Tipo del objeto almacenado, similar al nombre usado en STL. | |
| typedef value_type & | reference |
| Tipo del objeto almacenado, similar al nombre usado en STL. | |
| typedef const value_type & | const_reference |
| Tipo del objeto almacenado, similar al nombre usado en STL. | |
| typedef unsigned | size_type |
| Tipo del tamaño de un objeto, similar al nombre usado en STL. | |
Public Member Functions | |
| RefMatrix (unsigned m=1, unsigned n=1) | |
| Constructor base. | |
| RefMatrix (const RefMatrix &o) | |
| Constructor de copia. | |
| RefMatrix (const E &V) | |
| Construye una matriz unitaria. | |
| ~RefMatrix () | |
| Destructor. | |
| RefMatrix< E > * | clone () const |
| Retorna un puntero a una copia de la instancia. | |
| unsigned | rows () const |
| Cantidad de filas de la matriz. | |
| unsigned | cols () const |
| Cantidad de columnas de la Matriz. | |
| unsigned | size () const |
| Cantidad de valores almacenados en la matriz. | |
| unsigned | count () const |
| Cantidad de valores almacenados en la matriz. | |
| size_type | capacity () const |
| Cantidad máxima posible de valores diferentes que pueden ser almacenados en la matriz. | |
| Matrix & | copy (const Matrix &o) |
Copia desde "o". | |
| Matrix & | move (Matrix &o) |
Traslada el valor de "o" a "*this". | |
| Matrix & | swap (Matrix &o) |
Intercambia los valores de "*this" y "o". | |
| bool | equals (const Matrix &o) const |
| ¿¿¿ (*this==o) ??? | |
| bool | same (const Matrix &o) const |
Retorna true si "o" comparte sus valores con "*this". | |
| reference | operator() (unsigned, unsigned) |
| Retorna una referencia al elemento [i,j] de la matriz. | |
| const_reference | operator() (unsigned, unsigned) const |
Retorna una referencia al elemento [i,j] de la matriz ( const ). | |
| reference | at (unsigned m, unsigned n) |
Retorna operator()(m,n). | |
| const_reference | at (unsigned m, unsigned n) const |
Retorna operator()(m,n) "const". | |
| void | reSize (unsigned, unsigned) |
| Le cambia las dimensiones a la matriz. | |
| void | reShape (unsigned, unsigned) |
| Le ajusta las dimensiones a la matriz. | |
| void | transpose () |
| Transpone la matriz. | |
Protected Member Functions | |
| void | add (const Matrix &) |
Le suma a "*this" la matriz "O". | |
| void | substract (const Matrix &) |
Le resta a "*this" la matriz "O". | |
| void | multiply (const Matrix &, const Matrix &) |
Calcula la multiplicación A * B y la almacena en "*this". | |
Friends | |
| lkptr< RefMatrix > | operator+ (const lkptr< RefMatrix > &A, const lkptr< RefMatrix > &B) |
Retorna A+B. | |
| lkptr< RefMatrix > | operator- (const lkptr< RefMatrix > &A, const lkptr< RefMatrix > &B) |
Retorna A-B. | |
| lkptr< RefMatrix > | operator* (const lkptr< RefMatrix > &A, const lkptr< RefMatrix > &B) |
Retorna A*B. | |
| class | test_Matrix |
| Datos de prueba para la clase. | |
| bool | operator== (const Matrix &p, const Matrix &q) |
| ¿¿¿ (p == q) ??? | |
| bool | operator!= (const Matrix &p, const Matrix &q) |
| ¿¿¿ (p != q) ??? | |
| Matrix | operator+ (const Matrix &A, const Matrix &B) |
Retorna A+B. | |
| Matrix | operator- (const Matrix &A, const Matrix &B) |
Retorna A-B. | |
| Matrix | operator* (const Matrix &A, const Matrix &B) |
Retorna A*B. | |
| template<class T > | |
| bool | check_ok (const Matrix< T > &M) |
| Verifica la invariante de la clase. | |
Empaque alrededor de Matrix que usa lkptr<X> para mejorar la implementación de los operadores aritméticos.
Definition at line 28 of file RefMatrix.h.
typedef E Mx::Matrix< E >::value_type [inherited] |
typedef value_type& Mx::Matrix< E >::reference [inherited] |
typedef const value_type& Mx::Matrix< E >::const_reference [inherited] |
typedef unsigned Mx::Matrix< E >::size_type [inherited] |
| Mx::RefMatrix< E >::RefMatrix | ( | unsigned | m = 1, |
| unsigned | n = 1 |
||
| ) | [inline] |
Constructor base.
Definition at line 30 of file RefMatrix.h.
| Mx::RefMatrix< E >::RefMatrix | ( | const RefMatrix< E > & | o | ) | [inline] |
Constructor de copia.
Definition at line 31 of file RefMatrix.h.
| Mx::RefMatrix< E >::RefMatrix | ( | const E & | V | ) | [inline] |
Construye una matriz unitaria.
Definition at line 32 of file RefMatrix.h.
| Mx::RefMatrix< E >::~RefMatrix | ( | ) | [inline] |
Destructor.
Definition at line 33 of file RefMatrix.h.
| RefMatrix<E>* Mx::RefMatrix< E >::clone | ( | ) | const [inline] |
Retorna un puntero a una copia de la instancia.
Definition at line 36 of file RefMatrix.h.
| unsigned Mx::Matrix< E >::rows | ( | ) | const [inline, inherited] |
| unsigned Mx::Matrix< E >::cols | ( | ) | const [inline, inherited] |
| unsigned Mx::Matrix< E >::size | ( | ) | const [inline, inherited] |
| unsigned Mx::Matrix< E >::count | ( | ) | const [inline, inherited] |
| size_type Mx::Matrix< E >::capacity | ( | ) | const [inline, inherited] |
| Matrix< E > & Mx::Matrix< E >::copy | ( | const Matrix< E > & | o | ) | [inherited] |
Copia desde "o".
"o" sobre "*this", de forma que el nuevo valor de "*this" sea un duplicado exacto del valor de "o" "*this" se pierde"o" mantiene su valor anterior"o" cambia, el de "*this" no cambiará, y viceversa, pues la copia es una copia profunda; no es superficial"*this" es "o" entonces su valor no cambia *this == o | Matrix< E > & Mx::Matrix< E >::move | ( | Matrix< E > & | o | ) | [inherited] |
Traslada el valor de "o" a "*this".
"*this" se pierde"*this" es el que "o" tuvo"o" queda en el estado en que lo dejaría Erase() "*this" es "o" entonces su valor no cambia (*this == o) *this | Matrix< E > & Mx::Matrix< E >::swap | ( | Matrix< E > & | o | ) | [inline, inherited] |
Intercambia los valores de "*this" y "o".
"*this" en lugar de una referencia, como ocurre con Matrix::Child(), a veces swap() no tiene el resultado esperado por el programador. T.Child(i). swap( T.Child(j) ) el resultado no es intercambiar los hijos, sino más bien intercambiar los valores de los sub-árboles temporales T.Child(i) y T.Child(j). La forma correcta de intercambiar hijos es usar Graft().1 )| bool Mx::Matrix< E >::equals | ( | const Matrix< E > & | o | ) | const [inherited] |
| bool Mx::Matrix< E >::same | ( | const Matrix< E > & | o | ) | const [inline, inherited] |
| void Mx::Matrix< E >::add | ( | const Matrix< E > & | O | ) | [protected, inherited] |
Le suma a "*this" la matriz "O".
| void Mx::Matrix< E >::substract | ( | const Matrix< E > & | O | ) | [protected, inherited] |
Le resta a "*this" la matriz "O".
| void Mx::Matrix< E >::multiply | ( | const Matrix< E > & | A, |
| const Matrix< E > & | B | ||
| ) | [protected, inherited] |
Calcula la multiplicación A * B y la almacena en "*this".
"A" y "B" deben tener dimensiones compatibles A.cols() == B.rows() "A" debe ser igual a la cantidad de columnas de "B" A.cols() * B.cols() * A.cols() )| E & Mx::Matrix< E >::operator() | ( | unsigned | i, |
| unsigned | j | ||
| ) | [inline, inherited] |
| const E & Mx::Matrix< E >::operator() | ( | unsigned | i, |
| unsigned | j | ||
| ) | const [inline, inherited] |
| reference Mx::Matrix< E >::at | ( | unsigned | m, |
| unsigned | n | ||
| ) | [inline, inherited] |
| const_reference Mx::Matrix< E >::at | ( | unsigned | m, |
| unsigned | n | ||
| ) | const [inline, inherited] |
| void Mx::Matrix< E >::reSize | ( | unsigned | m, |
| unsigned | n | ||
| ) | [inherited] |
Le cambia las dimensiones a la matriz.
Matrix<E>::value_type(). (m * n == 0) deja la matriz vacía. | void Mx::Matrix< E >::reShape | ( | unsigned | m, |
| unsigned | n | ||
| ) | [inline, inherited] |
| void Mx::Matrix< E >::transpose | ( | ) | [inline, inherited] |
| lkptr<RefMatrix> operator+ | ( | const lkptr< RefMatrix< E > > & | A, |
| const lkptr< RefMatrix< E > > & | B | ||
| ) | [friend] |
Retorna A+B.
Definition at line 37 of file RefMatrix.h.
| lkptr<RefMatrix> operator- | ( | const lkptr< RefMatrix< E > > & | A, |
| const lkptr< RefMatrix< E > > & | B | ||
| ) | [friend] |
Retorna A-B.
Definition at line 39 of file RefMatrix.h.
| lkptr<RefMatrix> operator* | ( | const lkptr< RefMatrix< E > > & | A, |
| const lkptr< RefMatrix< E > > & | B | ||
| ) | [friend] |
Retorna A*B.
Definition at line 41 of file RefMatrix.h.
friend class test_Matrix [friend, inherited] |
Verifica la invariante de la clase.
0 (cero) al campo m_val.rows() cols() Ok()
(M.m_rows == 0) <==> (M.m_cols == 0)(M.m_rows == 0) <==> (M.m_val == 0)check_ok( m_val[k] )
1.7.4