Skip to content

Commit

Permalink
documentation extended and corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
gyrdym committed May 12, 2019
1 parent d0454e5 commit aeab165
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@
- `Matrix.fromFlattened` renamed to `Matrix.fromFlattenedList`
- benchmarks added for checking matrix initialization performance
- Performance enhancements
- Dart 2.3.0 supported

## 9.0.0
- `Vector`:
Expand Down
22 changes: 14 additions & 8 deletions lib/matrix.dart
Expand Up @@ -7,9 +7,11 @@ import 'package:xrange/zrange.dart';
/// An algebraic matrix
abstract class Matrix {
/// Creates a matrix from a two dimensional list, every nested list is a
/// representation for a row
/// There is no check of lists lengths in source due to performance,
/// keep it in mind, don't create a matrix from lists of different lengths
/// source for a matrix row.
///
/// There is no check of nested lists lengths in the [source] due to
/// performance, keep it in mind, don't create a matrix from nested lists of
/// different lengths
factory Matrix.fromList(List<List<double>> source,
{DType dtype = DType.float32}) {
switch (dtype) {
Expand All @@ -21,8 +23,10 @@ abstract class Matrix {
}

/// Creates a matrix with predefined row vectors
/// There is no check of vectors lengths in source due to performance,
/// keep it in mind, don't create a matrix from vectors of different lengths
///
/// There is no check of nested vectors lengths in the [source] due to
/// performance, keep it in mind, don't create a matrix from vectors lists of
/// different lengths
factory Matrix.fromRows(List<Vector> source, {DType dtype = DType.float32}) {
switch (dtype) {
case DType.float32:
Expand All @@ -33,8 +37,10 @@ abstract class Matrix {
}

/// Creates a matrix with predefined column vectors
/// There is no check of vectors lengths in source due to performance,
/// keep it in mind, don't create a matrix from vectors of different lengths
///
/// There is no check of nested vectors lengths in the [source] due to
/// performance, keep it in mind, don't create a matrix from nested vectors of
/// different lengths
factory Matrix.fromColumns(List<Vector> source,
{DType dtype = DType.float32}) {
switch (dtype) {
Expand All @@ -45,7 +51,7 @@ abstract class Matrix {
}
}

/// Creates a matrix from flattened iterable of length that is equal to
/// Creates a matrix from flattened list of length equal to
/// [rowsNum] * [columnsNum]
factory Matrix.fromFlattenedList(List<double> source, int rowsNum,
int columnsNum, {DType dtype = DType.float32}) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/common/typed_list_helper/typed_list_helper.dart
Expand Up @@ -13,7 +13,7 @@ abstract class TypedListHelper {
/// returns byte buffer in list representation
List<double> getBufferAsList(ByteBuffer buffer, [int start = 0, int length]);

/// set
/// sets a value to a given [ByteData] by the specified byte offset
void setValue(ByteData byteData, int byteOffset, double value,
[Endian endian]);
}

0 comments on commit aeab165

Please sign in to comment.