#include <map>
#include "CoinPackedVectorBase.hpp"
#include "CoinSort.hpp"
Go to the source code of this file.
Classes | |
class | CoinPackedVector |
Sparse Vector. More... | |
Defines | |
#define | COIN_DEFAULT_VALUE_FOR_DUPLICATE true |
Functions | |
double | sparseDotProduct (const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2) |
Returns the dot product of two CoinPackedVector objects whose elements are doubles. | |
double | sortedSparseDotProduct (const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2) |
Returns the dot product of two sorted CoinPackedVector objects. | |
void | CoinPackedVectorUnitTest () |
A function that tests the methods in the CoinPackedVector class. | |
Arithmetic operators on packed vectors. | |
NOTE: These methods operate on those positions where at least one of the arguments has a value listed. At those positions the appropriate operation is executed, Otherwise the result of the operation is considered 0. | |
template<class BinaryFunction > | |
void | binaryOp (CoinPackedVector &retVal, const CoinPackedVectorBase &op1, double value, BinaryFunction bf) |
Return the sum of two packed vectors. | |
template<class BinaryFunction > | |
void | binaryOp (CoinPackedVector &retVal, double value, const CoinPackedVectorBase &op2, BinaryFunction bf) |
Return the sum of two packed vectors. | |
template<class BinaryFunction > | |
void | binaryOp (CoinPackedVector &retVal, const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2, BinaryFunction bf) |
Return the sum of two packed vectors. | |
template<class BinaryFunction > | |
CoinPackedVector | binaryOp (const CoinPackedVectorBase &op1, double value, BinaryFunction bf) |
Return the sum of two packed vectors. | |
template<class BinaryFunction > | |
CoinPackedVector | binaryOp (double value, const CoinPackedVectorBase &op2, BinaryFunction bf) |
Return the sum of two packed vectors. | |
template<class BinaryFunction > | |
CoinPackedVector | binaryOp (const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2, BinaryFunction bf) |
Return the sum of two packed vectors. | |
CoinPackedVector | operator+ (const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2) |
Return the sum of two packed vectors. | |
CoinPackedVector | operator- (const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2) |
Return the difference of two packed vectors. | |
CoinPackedVector | operator* (const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2) |
Return the element-wise product of two packed vectors. | |
CoinPackedVector | operator/ (const CoinPackedVectorBase &op1, const CoinPackedVectorBase &op2) |
Return the element-wise ratio of two packed vectors. | |
Arithmetic operators on packed vector and a constant. <br> | |
CoinPackedVector | operator+ (const CoinPackedVectorBase &op1, double value) |
Return the sum of a packed vector and a constant. | |
CoinPackedVector | operator- (const CoinPackedVectorBase &op1, double value) |
Return the difference of a packed vector and a constant. | |
CoinPackedVector | operator* (const CoinPackedVectorBase &op1, double value) |
Return the element-wise product of a packed vector and a constant. | |
CoinPackedVector | operator/ (const CoinPackedVectorBase &op1, double value) |
Return the element-wise ratio of a packed vector and a constant. | |
CoinPackedVector | operator+ (double value, const CoinPackedVectorBase &op1) |
Return the sum of a constant and a packed vector. | |
CoinPackedVector | operator- (double value, const CoinPackedVectorBase &op1) |
Return the difference of a constant and a packed vector. | |
CoinPackedVector | operator* (double value, const CoinPackedVectorBase &op1) |
Return the element-wise product of a constant and a packed vector. | |
CoinPackedVector | operator/ (double value, const CoinPackedVectorBase &op1) |
Return the element-wise ratio of a a constant and packed vector. |
#define COIN_DEFAULT_VALUE_FOR_DUPLICATE true |
Definition at line 17 of file CoinPackedVector.hpp.
void binaryOp | ( | CoinPackedVector & | retVal, | |
const CoinPackedVectorBase & | op1, | |||
double | value, | |||
BinaryFunction | bf | |||
) |
Return the sum of two packed vectors.
Definition at line 349 of file CoinPackedVector.hpp.
void binaryOp | ( | CoinPackedVector & | retVal, | |
double | value, | |||
const CoinPackedVectorBase & | op2, | |||
BinaryFunction | bf | |||
) | [inline] |
Return the sum of two packed vectors.
Definition at line 366 of file CoinPackedVector.hpp.
void binaryOp | ( | CoinPackedVector & | retVal, | |
const CoinPackedVectorBase & | op1, | |||
const CoinPackedVectorBase & | op2, | |||
BinaryFunction | bf | |||
) |
Return the sum of two packed vectors.
Definition at line 374 of file CoinPackedVector.hpp.
CoinPackedVector binaryOp | ( | const CoinPackedVectorBase & | op1, | |
double | value, | |||
BinaryFunction | bf | |||
) |
Return the sum of two packed vectors.
Definition at line 422 of file CoinPackedVector.hpp.
CoinPackedVector binaryOp | ( | double | value, | |
const CoinPackedVectorBase & | op2, | |||
BinaryFunction | bf | |||
) |
Return the sum of two packed vectors.
Definition at line 432 of file CoinPackedVector.hpp.
CoinPackedVector binaryOp | ( | const CoinPackedVectorBase & | op1, | |
const CoinPackedVectorBase & | op2, | |||
BinaryFunction | bf | |||
) |
Return the sum of two packed vectors.
Definition at line 442 of file CoinPackedVector.hpp.
CoinPackedVector operator+ | ( | const CoinPackedVectorBase & | op1, | |
const CoinPackedVectorBase & | op2 | |||
) | [inline] |
Return the sum of two packed vectors.
Definition at line 453 of file CoinPackedVector.hpp.
CoinPackedVector operator- | ( | const CoinPackedVectorBase & | op1, | |
const CoinPackedVectorBase & | op2 | |||
) | [inline] |
Return the difference of two packed vectors.
Definition at line 463 of file CoinPackedVector.hpp.
CoinPackedVector operator* | ( | const CoinPackedVectorBase & | op1, | |
const CoinPackedVectorBase & | op2 | |||
) | [inline] |
Return the element-wise product of two packed vectors.
Definition at line 473 of file CoinPackedVector.hpp.
CoinPackedVector operator/ | ( | const CoinPackedVectorBase & | op1, | |
const CoinPackedVectorBase & | op2 | |||
) | [inline] |
Return the element-wise ratio of two packed vectors.
Definition at line 483 of file CoinPackedVector.hpp.
double sparseDotProduct | ( | const CoinPackedVectorBase & | op1, | |
const CoinPackedVectorBase & | op2 | |||
) | [inline] |
Returns the dot product of two CoinPackedVector objects whose elements are doubles.
Use this version if the vectors are *not* guaranteed to be sorted.
Definition at line 495 of file CoinPackedVector.hpp.
double sortedSparseDotProduct | ( | const CoinPackedVectorBase & | op1, | |
const CoinPackedVectorBase & | op2 | |||
) | [inline] |
Returns the dot product of two sorted CoinPackedVector objects.
The vectors should be sorted in ascending order of indices.
Definition at line 514 of file CoinPackedVector.hpp.
CoinPackedVector operator+ | ( | const CoinPackedVectorBase & | op1, | |
double | value | |||
) | [inline] |
Return the sum of a packed vector and a constant.
Definition at line 556 of file CoinPackedVector.hpp.
CoinPackedVector operator- | ( | const CoinPackedVectorBase & | op1, | |
double | value | |||
) | [inline] |
Return the difference of a packed vector and a constant.
Definition at line 565 of file CoinPackedVector.hpp.
CoinPackedVector operator* | ( | const CoinPackedVectorBase & | op1, | |
double | value | |||
) | [inline] |
Return the element-wise product of a packed vector and a constant.
Definition at line 574 of file CoinPackedVector.hpp.
CoinPackedVector operator/ | ( | const CoinPackedVectorBase & | op1, | |
double | value | |||
) | [inline] |
Return the element-wise ratio of a packed vector and a constant.
Definition at line 583 of file CoinPackedVector.hpp.
CoinPackedVector operator+ | ( | double | value, | |
const CoinPackedVectorBase & | op1 | |||
) | [inline] |
Return the sum of a constant and a packed vector.
Definition at line 594 of file CoinPackedVector.hpp.
CoinPackedVector operator- | ( | double | value, | |
const CoinPackedVectorBase & | op1 | |||
) | [inline] |
Return the difference of a constant and a packed vector.
Definition at line 603 of file CoinPackedVector.hpp.
CoinPackedVector operator* | ( | double | value, | |
const CoinPackedVectorBase & | op1 | |||
) | [inline] |
Return the element-wise product of a constant and a packed vector.
Definition at line 616 of file CoinPackedVector.hpp.
CoinPackedVector operator/ | ( | double | value, | |
const CoinPackedVectorBase & | op1 | |||
) | [inline] |
Return the element-wise ratio of a a constant and packed vector.
Definition at line 625 of file CoinPackedVector.hpp.
void CoinPackedVectorUnitTest | ( | ) |
A function that tests the methods in the CoinPackedVector class.
The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.