parent
18d548df63
commit
0dd0a0e50c
|
@ -137,7 +137,7 @@ func (m matrix) Augment(right matrix) (matrix, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// errMatrixSize is returned if matrix dimensions are doesn't match.
|
// errMatrixSize is returned if matrix dimensions are doesn't match.
|
||||||
var errMatrixSize = errors.New("matrix sizes does not match")
|
var errMatrixSize = errors.New("matrix sizes do not match")
|
||||||
|
|
||||||
func (m matrix) SameSize(n matrix) error {
|
func (m matrix) SameSize(n matrix) error {
|
||||||
if len(m) != len(n) {
|
if len(m) != len(n) {
|
||||||
|
|
|
@ -391,7 +391,7 @@ var ErrShardNoData = errors.New("no shard data")
|
||||||
|
|
||||||
// ErrShardSize is returned if shard length isn't the same for all
|
// ErrShardSize is returned if shard length isn't the same for all
|
||||||
// shards.
|
// shards.
|
||||||
var ErrShardSize = errors.New("shard sizes does not match")
|
var ErrShardSize = errors.New("shard sizes do not match")
|
||||||
|
|
||||||
// checkShards will check if shards are the same size
|
// checkShards will check if shards are the same size
|
||||||
// or 0, if allowed. An error is returned if this fails.
|
// or 0, if allowed. An error is returned if this fails.
|
||||||
|
|
|
@ -256,7 +256,7 @@ func trimShards(in [][]byte, size int) [][]byte {
|
||||||
|
|
||||||
func readShards(dst [][]byte, in []io.Reader) error {
|
func readShards(dst [][]byte, in []io.Reader) error {
|
||||||
if len(in) != len(dst) {
|
if len(in) != len(dst) {
|
||||||
panic("internal error: in and dst size does not match")
|
panic("internal error: in and dst size do not match")
|
||||||
}
|
}
|
||||||
size := -1
|
size := -1
|
||||||
for i := range in {
|
for i := range in {
|
||||||
|
@ -291,7 +291,7 @@ func readShards(dst [][]byte, in []io.Reader) error {
|
||||||
|
|
||||||
func writeShards(out []io.Writer, in [][]byte) error {
|
func writeShards(out []io.Writer, in [][]byte) error {
|
||||||
if len(out) != len(in) {
|
if len(out) != len(in) {
|
||||||
panic("internal error: in and out size does not match")
|
panic("internal error: in and out size do not match")
|
||||||
}
|
}
|
||||||
for i := range in {
|
for i := range in {
|
||||||
if out[i] == nil {
|
if out[i] == nil {
|
||||||
|
@ -318,7 +318,7 @@ type readResult struct {
|
||||||
// cReadShards reads shards concurrently
|
// cReadShards reads shards concurrently
|
||||||
func cReadShards(dst [][]byte, in []io.Reader) error {
|
func cReadShards(dst [][]byte, in []io.Reader) error {
|
||||||
if len(in) != len(dst) {
|
if len(in) != len(dst) {
|
||||||
panic("internal error: in and dst size does not match")
|
panic("internal error: in and dst size do not match")
|
||||||
}
|
}
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
wg.Add(len(in))
|
wg.Add(len(in))
|
||||||
|
@ -366,7 +366,7 @@ func cReadShards(dst [][]byte, in []io.Reader) error {
|
||||||
// cWriteShards writes shards concurrently
|
// cWriteShards writes shards concurrently
|
||||||
func cWriteShards(out []io.Writer, in [][]byte) error {
|
func cWriteShards(out []io.Writer, in [][]byte) error {
|
||||||
if len(out) != len(in) {
|
if len(out) != len(in) {
|
||||||
panic("internal error: in and out size does not match")
|
panic("internal error: in and out size do not match")
|
||||||
}
|
}
|
||||||
var errs = make(chan error, len(out))
|
var errs = make(chan error, len(out))
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
Loading…
Reference in New Issue