Skip to content

Implement Neg overloaded operator for Array #89

Closed
@Timmmm

Description

@Timmmm

Array should implement the unary negative operator. It is implemented in C++ by making a zero array of the same size and subtracting them. I guess something like this:

impl Neg for Array {
    fn neg(&self) -> Array {
        constant(0, self.dims()) - self
    }
}

Sorry I am new to Rust so that is probably all wrong. Also I can't find a good explanation for how copying/cloning arrays in ArrayFire works.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions