Revision 9f03e367

View differences:

utility/matrix.h
59 59
        {
60 60
            _cell_data[ij] = m._cell_data[ij];
61 61
        }
62
        return *this;
62 63
    }
63 64

  
64
    Vector<N> row_to_vector(int y)
65
    Vector<N> row_to_vector(int i) const
65 66
    {
66 67
        Vector<N> ret;
67
        for(int i = 0; i < N; i++)
68
        for (int j = 0; j < N; j++)
68 69
        {
69
            ret[i] = _cell[y*N+i];
70
            ret[j] = cell(i, j);
70 71
        }
71 72
        return ret;
72 73
    }
73 74

  
74
    Vector<N> col_to_vector(int x)
75
    Vector<N> col_to_vector(int j) const
75 76
    {
76 77
        Vector<N> ret;
77
        for(int i = 0; i < N; i++)
78
        for (int i = 0; i < N; i++)
78 79
        {
79
            ret[i] = _cell[i*N+x];
80
            ret[i] = cell(i, j);
80 81
        }
81 82
        return ret;
82 83
    }
83 84

  
84
    void vector_to_row(Vector<N> v, int row)
85
    void vector_to_row(const Vector<N>& v, int i)
85 86
    {
86
        for(int i = 0; i < N; i++)
87
        for (int j = 0; j < N; j++)
87 88
        {
88
            cell(row, i) = v(i);
89
            cell(i, j) = v[j];
89 90
        }
90 91
    }
91 92

  
92
    void vector_to_col(Vector<N> v, int col)
93
    void vector_to_col(const Vector<N>& v, int j)
93 94
    {
94
        for(int i = 0; i < N; i++)
95
        for (int i = 0; i < N; i++)
95 96
        {
96
            cell(i, col) = v(i);
97
            cell(i, j) = v[i];
97 98
        }
98 99
    }
99 100

  

Also available in: Unified diff