Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.Math.ConstLMatrixRow Class Reference

Vector expression proxy that views a single row of an underlying matrix. More...

+ Inheritance diagram for CDPL.Math.ConstLMatrixRow:

Public Member Functions

None __init__ (ConstLMatrixRow r)
 Contructs a copy of the ConstLMatrixRow instance r. More...
 
None __init__ (ConstLMatrixExpression m, int i)
 Constructs the row proxy viewing row i of m. More...
 
int getIndex ()
 Returns the row index this proxy refers to within the wrapped matrix. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
bool isEmpty ()
 Tells whether the row is empty (the wrapped matrix has zero columns). More...
 
int getSize ()
 Returns the size of the row (number of columns of the wrapped matrix). More...
 
int getElement (int i)
 Returns the element at column i of the row. More...
 
object toArray ()
 Converts the ConstLMatrixRow instance into a corresponding numpy.ndarray object. More...
 
ConstLMatrixExpression getData ()
 Returns the wrapped matrix. More...
 
bool __eq__ (ConstLMatrixRow r)
 Returns the result of the comparison operation self == r. More...
 
bool __eq__ (ConstLVectorExpression e)
 Returns the result of the comparison operation self == e. More...
 
bool __ne__ (ConstLMatrixRow r)
 Returns the result of the comparison operation self != r. More...
 
bool __ne__ (ConstLVectorExpression e)
 Returns the result of the comparison operation self != e. More...
 
int __call__ (int i)
 Returns the element at column i of the row. More...
 
int __getitem__ (int i)
 Returns the element at column i of the row. More...
 
int __len__ ()
 Returns the size of the row (number of columns of the wrapped matrix). More...
 
str __str__ ()
 Returns a string representation of the ConstLMatrixRow instance. More...
 
ConstLMatrixRow __pos__ ()
 Returns self. More...
 
ConstLVectorExpression __neg__ ()
 Returns the result of the operation self * -1. More...
 
ConstLVectorExpression __add__ (ConstLVectorExpression e)
 Returns the result of the addition operation self + e. More...
 
ConstLVectorExpression __sub__ (ConstLVectorExpression e)
 Returns the result of the subtraction operation self - e. More...
 
ConstLVectorExpression __mul__ (int t)
 Returns the result of the multiplication operation self * t. More...
 
ConstLVectorExpression __mul__ (ConstLMatrixExpression e)
 Returns the result of the multiplication operation self * e. More...
 
ConstLVectorExpression __div__ (int t)
 Returns the result of the division operation self // t. More...
 
ConstLVectorExpression __truediv__ (int t)
 Returns the result of the true division operation self / t. More...
 
ConstLVectorExpression __rmul__ (int t)
 Returns the result of the multiplication operation t * self. More...
 

Properties

 objectID = property(getObjectID)
 
 size = property(getSize)
 
 data = property(getData)
 
 index = property(getIndex)
 

Detailed Description

Vector expression proxy that views a single row of an underlying matrix.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Math.ConstLMatrixRow.__init__ ( ConstLMatrixRow  r)

Contructs a copy of the ConstLMatrixRow instance r.

Parameters
rThe ConstLMatrixRow instance to copy.

◆ __init__() [2/2]

None CDPL.Math.ConstLMatrixRow.__init__ ( ConstLMatrixExpression  m,
int  i 
)

Constructs the row proxy viewing row i of m.

Parameters
mThe wrapped matrix.
iThe zero-based row index to view.

Member Function Documentation

◆ getIndex()

int CDPL.Math.ConstLMatrixRow.getIndex ( )

Returns the row index this proxy refers to within the wrapped matrix.

Returns
The zero-based row index.

◆ getObjectID()

int CDPL.Math.ConstLMatrixRow.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python ConstLMatrixRow instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two ConstLMatrixRow instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ isEmpty()

bool CDPL.Math.ConstLMatrixRow.isEmpty ( )

Tells whether the row is empty (the wrapped matrix has zero columns).

Returns
True if the wrapped matrix has zero columns, and False otherwise.

◆ getSize()

int CDPL.Math.ConstLMatrixRow.getSize ( )

Returns the size of the row (number of columns of the wrapped matrix).

Returns
The number of columns.

◆ getElement()

int CDPL.Math.ConstLMatrixRow.getElement ( int  i)

Returns the element at column i of the row.

Parameters
iThe zero-based column index.
Returns
The value of the element m(index, i).

◆ toArray()

object CDPL.Math.ConstLMatrixRow.toArray ( )

Converts the ConstLMatrixRow instance into a corresponding numpy.ndarray object.

Returns
The generated numpy.ndarray object.
See also
[NUMPY]

◆ getData()

ConstLMatrixExpression CDPL.Math.ConstLMatrixRow.getData ( )

Returns the wrapped matrix.

Returns
The wrapped matrix.

◆ __eq__() [1/2]

bool CDPL.Math.ConstLMatrixRow.__eq__ ( ConstLMatrixRow  r)

Returns the result of the comparison operation self == r.

Parameters
rThe ConstLMatrixRow instance to be compared with.
Returns
The result of the comparison operation.

◆ __eq__() [2/2]

bool CDPL.Math.ConstLMatrixRow.__eq__ ( ConstLVectorExpression  e)

Returns the result of the comparison operation self == e.

Parameters
eThe ConstLVectorExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [1/2]

bool CDPL.Math.ConstLMatrixRow.__ne__ ( ConstLMatrixRow  r)

Returns the result of the comparison operation self != r.

Parameters
rThe ConstLMatrixRow instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [2/2]

bool CDPL.Math.ConstLMatrixRow.__ne__ ( ConstLVectorExpression  e)

Returns the result of the comparison operation self != e.

Parameters
eThe ConstLVectorExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __call__()

int CDPL.Math.ConstLMatrixRow.__call__ ( int  i)

Returns the element at column i of the row.

Parameters
iThe zero-based column index.
Returns
The value of the element m(index, i).

◆ __getitem__()

int CDPL.Math.ConstLMatrixRow.__getitem__ ( int  i)

Returns the element at column i of the row.

Parameters
iThe zero-based column index.
Returns
The value of the element m(index, i).

◆ __len__()

int CDPL.Math.ConstLMatrixRow.__len__ ( )

Returns the size of the row (number of columns of the wrapped matrix).

Returns
The number of columns.

◆ __str__()

str CDPL.Math.ConstLMatrixRow.__str__ ( )

Returns a string representation of the ConstLMatrixRow instance.

Returns
The generated string representation.

◆ __pos__()

ConstLMatrixRow CDPL.Math.ConstLMatrixRow.__pos__ ( )

Returns self.

Returns
self.

◆ __neg__()

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__neg__ ( )

Returns the result of the operation self * -1.

Returns
A ConstLVectorExpression instance holding the result of the element negation.

◆ __add__()

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__add__ ( ConstLVectorExpression  e)

Returns the result of the addition operation self + e.

Parameters
eSpecifies the second addend.
Returns
A ConstLVectorExpression instance holding the result of the addition.

◆ __sub__()

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__sub__ ( ConstLVectorExpression  e)

Returns the result of the subtraction operation self - e.

Parameters
eSpecifies the subtrahend.
Returns
A ConstLMatrixRow instance holding the result of the subtraction.

◆ __mul__() [1/2]

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__mul__ ( int  t)

Returns the result of the multiplication operation self * t.

Parameters
tSpecifies the multiplier.
Returns
A ConstLVectorExpression instance holding the result of the multiplication.

◆ __mul__() [2/2]

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__mul__ ( ConstLMatrixExpression  e)

Returns the result of the multiplication operation self * e.

Parameters
eSpecifies the multiplier.
Returns
A ConstLVectorExpression instance holding the result of the multiplication.

◆ __div__()

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__div__ ( int  t)

Returns the result of the division operation self // t.

Parameters
tSpecifies the divisor.
Returns
A ConstLVectorExpression instance holding the result of the division.

◆ __truediv__()

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__truediv__ ( int  t)

Returns the result of the true division operation self / t.

Parameters
tSpecifies the divisor.
Returns
A ConstLVectorExpression instance holding the result of the division.

◆ __rmul__()

ConstLVectorExpression CDPL.Math.ConstLMatrixRow.__rmul__ ( int  t)

Returns the result of the multiplication operation t * self.

Parameters
tSpecifies the multiplicand.
Returns
A ConstLVectorExpression instance holding the result of the multiplication.