@@ -149,15 +149,15 @@ Convenience macros `@MVector`, `@MMatrix` and `@MArray` are provided.
149
149
### ` SizedArray ` : a decorate size wrapper for ` Array `
150
150
151
151
Another convenient mutable type is the ` SizedArray ` , which is just a wrapper-type
152
- about a standard Julia ` Array ` which declares its knwon size. For example, if
152
+ about a standard Julia ` Array ` which declares its known size. For example, if
153
153
we knew that ` a ` was a 2×2 ` Matrix ` , then we can type ` sa = SizedArray{Tuple{2,2}}(a) `
154
154
to construct a new object which knows the type (the size will be verified
155
155
automatically). A more convenient syntax for obtaining a ` SizedArray ` is by calling
156
156
a ` Size ` object, e.g. ` sa = Size(2,2)(a) ` .
157
157
158
158
Then, methods on ` sa ` will use the specialized code provided by the * StaticArrays*
159
- pacakge , which in many cases will be much, much faster. For example, calling
160
- ` eig (sa)` will be signficantly faster than ` eig (a)` since it will perform a
159
+ package , which in many cases will be much, much faster. For example, calling
160
+ ` eigen (sa)` will be signficantly faster than ` eigen (a)` since it will perform a
161
161
specialized 2×2 matrix diagonalization rather than a general algorithm provided
162
162
by Julia and * LAPACK* .
163
163
@@ -166,9 +166,9 @@ an `MArray` might be preferable.
166
166
167
167
### ` FieldVector `
168
168
169
- Sometimes it might be useful to imbue your own types, having multiple fields,
170
- with vector-like properties. * StaticArrays* can take care of this for you by
171
- allowing you to inherit from ` FieldVector{N, T} ` . For example, consider:
169
+ Sometimes it is useful to give your own struct types the properties of a vector.
170
+ * StaticArrays* can take care of this for you by allowing you to inherit from
171
+ ` FieldVector{N, T} ` . For example, consider:
172
172
173
173
``` julia
174
174
struct Point3D <: FieldVector{3, Float64}
@@ -194,7 +194,7 @@ appropriate method for `similar`,
194
194
### Implementing your own types
195
195
196
196
You can easily create your own ` StaticArray ` type, by defining linear
197
- ` getindex ` (and optionally ` setindex! ` for mutable types - see
197
+ ` getindex ` (and optionally ` setindex! ` for mutable types --- see
198
198
` setindex(::MArray, val, i) ` in * MArray.jl* for an example of how to
199
199
achieve this through pointer manipulation). Your type should define a constructor
200
200
that takes a tuple of the data (and mutable containers may want to define a
@@ -234,7 +234,7 @@ instance, e.g. `Size(2)(v)`.
234
234
### Arrays of static arrays
235
235
236
236
Storing a large number of static arrays is convenient as an array of static
237
- arrays. For example, a collection of positions (3D coordinates - ` SVector{3,Float64} ` )
237
+ arrays. For example, a collection of positions (3D coordinates --- ` SVector{3,Float64} ` )
238
238
could be represented as a ` Vector{SVector{3,Float64}} ` .
239
239
240
240
Another common way of storing the same data is as a 3×` N ` ` Matrix{Float64} ` .
0 commit comments