| 864 | /** \internal |
| 865 | * A vector object that is equal to 0 everywhere but v at the position i */ |
| 866 | class SingletonVector |
| 867 | { |
| 868 | StorageIndex m_index; |
| 869 | StorageIndex m_value; |
| 870 | public: |
| 871 | typedef StorageIndex value_type; |
| 872 | SingletonVector(Index i, Index v) |
| 873 | : m_index(convert_index(i)), m_value(convert_index(v)) |
| 874 | {} |
| 875 | |
| 876 | StorageIndex operator[](Index i) const { return i==m_index ? m_value : 0; } |
| 877 | }; |
| 878 | |
| 879 | /** \internal |
| 880 | * \sa insert(Index,Index) */ |