Skip to content

Add method for multiply-add aka axpy #88

Closed

Description

@bluss

Two reasons:

  • Blas offers this as axpy, so it can be optimized (note: axpy is for vectors, not strided matrix)
  • It's a common case.

This operation is already _available efficiently_ using .zip_mut_with:

a1.zip_mut_with(&a2, |x, &y| *x += k * y)

The question is if this is so common and the zip_mut_with so ugly that it warrants its own method.

Activity

  1. bluss commented on Mar 15, 2016

    @bluss
    MemberAuthor

    This interface is actually cool:

            self.w += Scaled(-step, &dt1);
            self.y += Scaled(-step, &dt2);

    The problem is that if we provide AddAssign for Scaled, we'd probably better implement all operators for Scaled, and that quickly grows out of proportion..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions