Instance Constructors
-
new
expand()
Value Members
-
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
def
macroTransform(annottees: Any*): Any
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
expand is a macro annotation that is kind of like @specialized, but it's more of a templating mechanism. It is pretty... alpha in that the functionality is basically there, but it is now in the least bit battle tested. Don't ask much of it, and it will do fine, ask a lot, and well...
Basically, expand takes a def with type arguments whose types are annotated with breeze.macros.expand.args and generates the cross product of all combinations. For example:
will generate
The real power comes from breeze.macros.expand.sequence, which annotates an argument to the method to correlate with a type (the first argument to sequence) and then a sequence of trees which are inlined in place of references to the argument. For example:
will generate
See breeze.linalg.DenseVectorOps for a more complete example.