\internal * A vector object that is equal to 0 everywhere but v at the position i */
| 815 | /** \internal |
| 816 | * A vector object that is equal to 0 everywhere but v at the position i */ |
| 817 | class SingletonVector |
| 818 | { |
| 819 | Index m_index; |
| 820 | Index m_value; |
| 821 | public: |
| 822 | typedef Index value_type; |
| 823 | SingletonVector(Index i, Index v) |
| 824 | : m_index(i), m_value(v) |
| 825 | {} |
| 826 | |
| 827 | Index operator[](Index i) const { return i==m_index ? m_value : 0; } |
| 828 | }; |
| 829 | |
| 830 | /** \internal |
| 831 | * \sa insert(Index,Index) */ |