Skip to content

Commit

Permalink
[Doc] Update type.md (taichi-dev#7038)
Browse files Browse the repository at this point in the history
Since we have made `matrix` and `vector` to be different types in
v1.4.0, the documentation needs to be updated.
  • Loading branch information
neozhaoliang authored and lin-hitonami committed Jan 9, 2023
1 parent 0d23dc4 commit 7db9992
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions docs/lang/articles/type_system/type.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,6 @@ def test():
print(length(v))
```

In practical terms, `ti.types.matrix` only would suffice your need for vector/matrix customization because Taichi treats vectors as a special kind of matrices, i.e., matrices with one column.

In fact, calling `ti.types.vector()` produces a matrix type of a single column:

```
vec3 = ti.types.vector(3, float) # Equivalent to vec3 = ti.types.matrix(3, 1, float)
```

Similarly, `ti.Vector()` simply converts the input into a matrix of a single column:

```python
v = ti.Vector([1, 1, 1]) # equivalent to v = ti.Matrix([[1], [1], [1]])
```


### Struct types and dataclass

Expand Down

0 comments on commit 7db9992

Please sign in to comment.