- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Vol-1.2.0/CoinUtils/src/CoinDenseVector.hpp File Reference

`#include <cassert>`
`#include <cstdlib>`
`#include <cmath>`
`#include "CoinHelperFunctions.hpp"`

Include dependency graph for CoinDenseVector.hpp:

Go to the source code of this file.

## Classes
class | CoinDenseVector< T >
| Dense Vector. More...
## Arithmetic operators on dense vectors.
NOTE: Because these methods return an object (they can't return a reference, though they could return a pointer...) they are very inefficient...
template<typename T>
CoinDenseVector< T > | operator+ (const CoinDenseVector< T > &op1, const CoinDenseVector< T > &op2)
| Return the sum of two dense vectors.
template<typename T>
CoinDenseVector< T > | operator- (const CoinDenseVector< T > &op1, const CoinDenseVector< T > &op2)
| Return the difference of two dense vectors.
template<typename T>
CoinDenseVector< T > | operator * (const CoinDenseVector< T > &op1, const CoinDenseVector< T > &op2)
| Return the element-wise product of two dense vectors.
template<typename T>
CoinDenseVector< T > | operator/ (const CoinDenseVector< T > &op1, const CoinDenseVector< T > &op2)
| Return the element-wise ratio of two dense vectors.
## Arithmetic operators on dense vector and a constant.
These functions create a dense vector as a result. That dense vector will have the same indices as `op1` and the specified operation is done entry-wise with the given value.
template<typename T>
CoinDenseVector< T > | operator+ (const CoinDenseVector< T > &op1, T value)
| Return the sum of a dense vector and a constant.
template<typename T>
CoinDenseVector< T > | operator- (const CoinDenseVector< T > &op1, T value)
| Return the difference of a dense vector and a constant.
template<typename T>
CoinDenseVector< T > | operator * (const CoinDenseVector< T > &op1, T value)
| Return the element-wise product of a dense vector and a constant.
template<typename T>
CoinDenseVector< T > | operator/ (const CoinDenseVector< T > &op1, T value)
| Return the element-wise ratio of a dense vector and a constant.
template<typename T>
CoinDenseVector< T > | operator+ (T value, const CoinDenseVector< T > &op1)
| Return the sum of a constant and a dense vector.
template<typename T>
CoinDenseVector< T > | operator- (T value, const CoinDenseVector< T > &op1)
| Return the difference of a constant and a dense vector.
template<typename T>
CoinDenseVector< T > | operator * (T value, const CoinDenseVector< T > &op1)
| Return the element-wise product of a constant and a dense vector.
template<typename T>
CoinDenseVector< T > | operator/ (T value, const CoinDenseVector< T > &op1)
| Return the element-wise ratio of a a constant and dense vector.
## Functions
template<typename T>
void | CoinDenseVectorUnitTest (T dummy)
| A function that tests the methods in the CoinDenseVector class.

## Function Documentation

template<typename T>

void CoinDenseVectorUnitTest | ( | T | dummy | ) |

A function that tests the methods in the CoinDenseVector 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.

template<typename T>

CoinDenseVector<T> operator+ | ( | const CoinDenseVector< T > & | op1,
|  | const CoinDenseVector< T > & | op2 |
| ) |  |  | `[inline]`

Return the sum of two dense vectors.

Definition at line 211 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator- | ( | const CoinDenseVector< T > & | op1,
|  | const CoinDenseVector< T > & | op2 |
| ) |  |  | `[inline]`

Return the difference of two dense vectors.

Definition at line 226 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator * | ( | const CoinDenseVector< T > & | op1,
|  | const CoinDenseVector< T > & | op2 |
| ) |  |  | `[inline]`

Return the element-wise product of two dense vectors.

Definition at line 242 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator/ | ( | const CoinDenseVector< T > & | op1,
|  | const CoinDenseVector< T > & | op2 |
| ) |  |  | `[inline]`

Return the element-wise ratio of two dense vectors.

Definition at line 257 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator+ | ( | const CoinDenseVector< T > & | op1,
|  | T | value |
| ) |  |  | `[inline]`

Return the sum of a dense vector and a constant.

Definition at line 278 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator- | ( | const CoinDenseVector< T > & | op1,
|  | T | value |
| ) |  |  | `[inline]`

Return the difference of a dense vector and a constant.

Definition at line 291 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator * | ( | const CoinDenseVector< T > & | op1,
|  | T | value |
| ) |  |  | `[inline]`

Return the element-wise product of a dense vector and a constant.

Definition at line 304 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator/ | ( | const CoinDenseVector< T > & | op1,
|  | T | value |
| ) |  |  | `[inline]`

Return the element-wise ratio of a dense vector and a constant.

Definition at line 317 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator+ | ( | T | value,
|  | const CoinDenseVector< T > & | op1 |
| ) |  |  | `[inline]`

Return the sum of a constant and a dense vector.

Definition at line 330 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator- | ( | T | value,
|  | const CoinDenseVector< T > & | op1 |
| ) |  |  | `[inline]`

Return the difference of a constant and a dense vector.

Definition at line 343 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator * | ( | T | value,
|  | const CoinDenseVector< T > & | op1 |
| ) |  |  | `[inline]`

Return the element-wise product of a constant and a dense vector.

Definition at line 356 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().

template<typename T>

CoinDenseVector<T> operator/ | ( | T | value,
|  | const CoinDenseVector< T > & | op1 |
| ) |  |  | `[inline]`

Return the element-wise ratio of a a constant and dense vector.

Definition at line 369 of file CoinDenseVector.hpp.

References CoinDenseVector< T >::getElements(), and CoinDenseVector< T >::size().