Repository: systemml Updated Branches: refs/heads/gh-pages 573427fb5 -> 936846406
[SYSTEMML-540] Added an assert builtin function - Assert function halts the execution of DML program if the boolean argument doesnot evaluate to TRUE. - Like stop, assert is not supported inside a parfor. - Caffe2DML inserts assert function in non-parfor cases for affine layer. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/93684640 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/93684640 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/93684640 Branch: refs/heads/gh-pages Commit: 936846406cc909967cee02c7781b53c1c0a0abdd Parents: 573427f Author: Niketan Pansare <[email protected]> Authored: Fri Jan 19 14:46:26 2018 -0800 Committer: Niketan Pansare <[email protected]> Committed: Fri Jan 19 14:46:26 2018 -0800 ---------------------------------------------------------------------- dml-language-reference.md | 1 + 1 file changed, 1 insertion(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/93684640/dml-language-reference.md ---------------------------------------------------------------------- diff --git a/dml-language-reference.md b/dml-language-reference.md index a0cc0f7..5fb9de5 100644 --- a/dml-language-reference.md +++ b/dml-language-reference.md @@ -1542,6 +1542,7 @@ append() | Append a string to another string separated by "\n" <br/> Limitation: toString() | Formats a Matrix or Frame object into a string. <br/> "rows" & "cols" : number of rows and columns to print<br/> "decimal" : number of digits after the decimal<br/>"sparse" : set to TRUE to print Matrix object in sparse format, i.e. _RowIndex_ _ColIndex_ _Value_<br/>"sep" and "linesep" : inter-element separator and the line separator strings| Input : (<matrix> or <frame>,<br/> rows=100,<br/> cols=100,<br/> decimal=3,<br/> sparse=FALSE,<br/> sep=" ",<br/> linesep="\n") <br/> Output: <string> | X = matrix(seq(1, 9), rows=3, cols=3)<br/>str = toString(X, sep=" \| ") <br/><br/>F = as.frame(X)<br/>print(toString(F, rows=2, cols=2)) print() | Prints a scalar variable. The print() function allows printf-style formatting by optionally allowing multiple arguments, where the first argument is the string that specifies the formatting and the additional arguments are the arguments to format. | Input: <scalar><br/>or<br/><string, args...> | print("hello") <br/> print("hello" + "world") <br/> print("value of x is " + x ) <br/><br/>a='hello';<br/>b=3;<br/>c=4.5;<br/>d=TRUE;<br/>print('%s %d %f %b', a, b, c, d); <br/><br/>a='hello';<br/>b='goodbye';<br/>c=4;<br/>d=3;<br/>e=3.0;<br/>f=5.0;<br/>g=FALSE;<br/>print('%s %d %f %b', (a+b), (c-d), (e*f), !g); stop() | Halts the execution of DML program by printing the message that is passed in as the argument. <br/> Note that the use of stop() is not allowed inside a parfor loop. | Input: (<scalar>) | stop("Inputs to DML program are invalid") <br/> stop("Class labels must be either -1 or +1") +assert() | Halts the execution of DML program if the boolean argument doesnot evaluate to TRUE. <br/> Note that the use of assert() is not allowed inside a parfor loop. | Input: (<scalar of type boolean>) | assert(1 != 2) order() | Sort a column of the matrix X in decreasing/increasing order and return either index (index.return=TRUE) or data (index.return=FALSE). | Input: (target=X, by=column, decreasing, index.return) | order(X, by=1, decreasing=FALSE, index.return=FALSE)
