func NewRandomMatrix(rows, cols int, sampler sample.Sampler) (Matrix, error) {
	mat := make([]Vector, rows)
	for i := 0; i < rows; i++ {
		vec, err := NewRandomVector(cols, sampler)
		if err != nil {
			return nil, err
		}
		mat[i] = vec
	}
	return NewMatrix(mat)
}
NewRandomMatrix returns a new Matrix instance
with random elements sampled by the provided sample.Sampler.
Returns an error in case of sampling failure.
package data
import (
	"fmt"
	"math/big"
	"github.com/fentec-project/bn256"
	"github.com/fentec-project/gofe/sample"
)
type Matrix []Vector
func NewMatrix(vectors []Vector) (Matrix, error) {
	l := -1
	newVectors := make([]Vector, len(vectors))
	if len(vectors) > 0 {
		l = len(vectors[0])
	}
	for i, v := range vectors {
		if len(v) != l {
			return nil, fmt.Errorf("all vectors should be of the same length")
		}
		newVectors[i] = NewVector(v)
	}
	return Matrix(newVectors), nil
}