Skip to content

Commit

Permalink
[UPDATE] README style.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Jun 1, 2015
1 parent 015b209 commit c2b08e7
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ var mat = matrix( data, [2,2], 'uint32' );


---
### Properties
## Properties

A `Matrix` has the following properties...


<a name="matrix-dtype" class="read-only-property"></a>
##### <a><i>#</i></a> <i>dtype</i>
#### dtype

A __read-only__ property returning the underlying storage data type.

Expand All @@ -101,7 +101,7 @@ var dtype = mat.dtype;
```

<a name="matrix-ndims" class="read-only-property"></a>
##### <a><i>#</i></a> <i>ndims</i>
#### ndims

A __read-only__ property returning the number of dimensions.

Expand All @@ -111,7 +111,7 @@ var ndims = mat.ndims;
```

<a name="matrix-shape" class="read-only-property"></a>
##### <a><i>#</i></a> <i>shape</i>
#### shape

A __read-only__ property returning the matrix `shape`.

Expand All @@ -121,7 +121,7 @@ var shape = mat.shape;
```

<a name="matrix-strides" class="read-only-property"></a>
##### strides
#### strides

A __read-only__ property returning the `strides` used to index into the underlying data store.

Expand All @@ -131,7 +131,7 @@ var strides = mat.strides;
```

<a name="matrix-length" class="read-only-property"></a>
##### length
#### length

A __read-only__ property returning the matrix `length`; i.e., how many elements are in the `Matrix`, similar to [`Array#length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length).

Expand All @@ -156,7 +156,7 @@ value = mat[ 3 ];
```

<a name="matrix-nbytes" class="read-only-property"></a>
##### nbytes
#### nbytes

A __read-only__ property returning the number of bytes consumed by the `Matrix` elements.

Expand All @@ -166,7 +166,7 @@ var nbytes = mat.nbytes;
```

<a name="matrix-data" class="read-only-property"></a>
##### data
#### data

A __read-only__ property pointing to the underlying storage array.

Expand All @@ -176,15 +176,15 @@ var data = mat.data;
```

---
### Methods
## Methods

A `Matrix` has the following methods...


#### Set Methods
### Set Methods

<a name="matrix-set"></a>
##### Matrix.prototype.set( i, j, value )
#### Matrix.prototype.set( i, j, value )

Sets a `Matrix` element located at a row and column index.

Expand Down Expand Up @@ -215,7 +215,7 @@ __Note__: out-of-bounds row and column indices will silently fail.


<a name="matrix-iset"></a>
##### Matrix.prototype.iset( index, value )
#### Matrix.prototype.iset( index, value )

Sets a `Matrix` element located at a specified [`index`](#linear-indexing). If `index < 0`, the index refers to a position relative to the `Matrix` length, where `index = -1` corresponds to the last element.

Expand Down Expand Up @@ -243,7 +243,7 @@ __Note__: out-of-bounds indices will silently fail.


<a name="matrix-mset"></a>
##### Matrix.prototype.mset( idx[, cols], value[, thisArg] )
#### Matrix.prototype.mset( idx[, cols], value[, thisArg] )

Sets multiple `Matrix` elements. If provided a single `array`, `idx` is treated as an `array` of [linear indices](#linear-indexing). The `value` argument may be either a `number` primitive, a `Matrix` containing values to set, or a callback `function`.

Expand Down Expand Up @@ -333,7 +333,7 @@ __Notes__:


<a name="matrix-sset"></a>
##### Matrix.prototype.sset( subsequence, value[, thisArg] )
#### Matrix.prototype.sset( subsequence, value[, thisArg] )

Sets `Matrix` elements according to a specified [`subsequence`](https://github.com/compute-io/indexspace). The `subsequence` must specify __both__ row and column subsequences; e.g., `'3:7,5:9'`, where `3:7` corresponds to row indices `3,4,5,6` and `5:9` corresponds to column indices `5,6,7,8`. The second argument may be either a `number` primitive, a `Matrix` containing values to set, or a callback `function`.

Expand Down Expand Up @@ -416,10 +416,10 @@ __Notes__:


===
#### Get Methods
### Get Methods

<a name="matrix-get"></a>
##### Matrix.prototype.get( i, j )
#### Matrix.prototype.get( i, j )

Returns a `Matrix` element located at a row and column index.

Expand Down Expand Up @@ -447,7 +447,7 @@ __Note__: out-of-bounds row and column indices will return a value of `undefined


<a name="matrix-iget"></a>
##### Matrix.prototype.iget( index )
#### Matrix.prototype.iget( index )

Returns a `Matrix` element located at a specified [`index`](#linear-indexing). If `index < 0`, the index refers to a position relative to the `Matrix` length, where `index = -1` corresponds to the last element.

Expand All @@ -463,7 +463,7 @@ __Note__: out-of-bounds indices will return a value of `undefined`.


<a name="matrix-mget"></a>
##### Matrix.prototype.mget( idx[, cols] )
#### Matrix.prototype.mget( idx[, cols] )

Returns multiple `Matrix` elements. If provided a single argument, the method treats `idx` as an `array` of [linear indices](#linear-indexing) (`idx[i] >= 0`) and returns a plain `array` of numeric values. Otherwise, `idx` and `cols` are `integer` arrays which specify row and column indices and the method returns a new `Matrix` instance.

Expand Down Expand Up @@ -524,7 +524,7 @@ __Note__: out-of-bounds indices are ignored.


<a name="matrix-sget"></a>
##### Matrix.prototype.sget( subsequence )
#### Matrix.prototype.sget( subsequence )

Returns `Matrix` elements in a new `Matrix` according to a specified [`subsequence`](https://github.com/compute-io/indexspace). The `subsequence` must specify __both__ row and column subsequences; e.g., `'3:7,5:9'`, where `3:7` corresponds to row indices `3,4,5,6` and `5:9` corresponds to column indices `5,6,7,8`. If a `subsequence` does not correspond to any `Matrix` elements, the method returns an empty `Matrix`.

Expand Down Expand Up @@ -577,10 +577,10 @@ __Notes__:



#### Accessor Methods
### Accessor Methods

<a name="matrix-tostring"></a>
##### Matrix.prototype.toString()
#### Matrix.prototype.toString()

Returns a `string` representation of a `Matrix`. This method is similar to [`Array#toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString), except that rows are delineated by __semicolons__ and column values are delineated by __commas__.

Expand Down Expand Up @@ -616,7 +616,7 @@ for ( i = 0; i < rows.length; i++ ) {

---
<a name="matrix-constructor"></a>
### Constructor
## Constructor

A `Matrix` has a constructor having the following interface...

Expand Down Expand Up @@ -648,7 +648,7 @@ __Note__: while more performant, constructing a `Matrix` in this manner should b


---
### Raw
## Raw

For performance, a lower-level interface is provided which forgoes some of the guarantees of the above API, such as input argument validation and measures to prevent `Matrices` from becoming corrupted. While use of the above API is encouraged in REPL environments, use of the lower-level interface may be warranted when arguments are of a known type or when many `Matrices` must be created.

Expand Down Expand Up @@ -696,7 +696,7 @@ var mat = matrix.raw( data, [5,2], 'float32' );


---
### Notes
## Notes

#### Linear Indexing

Expand Down

0 comments on commit c2b08e7

Please sign in to comment.