Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dml style guide #36

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/site/dml-vs-r-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,41 @@ guide covers various practical functions or operations.

NOTE: This document is still a work in progress.

## DML styleguide

Indentation: `2 spaces`
Semi-colons: `Optional`
Spaces between words and parenthesis: `if( check & (it%%2 == 0) )`
Example variable naming:
```
# matrices named in Capitals
X = read(fileX)

# double values named in small letters
m = nrow(X)

# constructed matrices (general use)
row_nonzeros = matrix(0,rows=1,cols=1)

# Assign aggregated values for clear & readable naming
norm_G2 = sum (G ^ 2)

# Boolean flags
converged = FALSE
```

Custom user defined functions

```dml
m_csplineDS = function (Matrix[Double] X, Matrix[Double] Y, Double inp_x)
return (Matrix[Double] pred_Y)
{
print("This is a builtin function")
pred_Y = matrix(y, 1, 1)
}
```


## Table of Contents

* [Multiple outputs](#multiple-outputs)
Expand Down