obimatrix bugs

This commit is contained in:
Eric Coissac
2025-11-21 13:09:24 +01:00
parent ccc827afd3
commit e65b2a5efe
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "d35a32b"
var _Commit = "27204d5"
var _Version = "Release 4.4.0"
// Version returns the version of the obitools package.

View File

@@ -54,13 +54,13 @@ func NewMatrixData(naValue string, attributes ...string) *MatrixData {
// It returns a pointer to the transposed MatrixData.
func (matrix *MatrixData) TransposeMatrixData() *MatrixData {
m := MakeMatrixData(matrix.naValue, "id")
for k, v := range *&matrix.matrix {
for k, v := range matrix.matrix {
for kk, vv := range v {
if _, ok := m.matrix[kk]; !ok {
m.matrix[kk] = make(map[string]interface{})
}
m.matrix[kk][k] = vv
m.attributes[kk] = map[string]interface{}{"id": k}
m.attributes[kk] = map[string]interface{}{"id": kk}
}
}
return &m