GithubHelp home page GithubHelp logo

cppnumpy's People

Contributors

anuranbaka avatar jacobsercombe avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cppnumpy's Issues

Indexing with a mask could broadcast

Broadcasting behavior currently isn't implemented when using a matrix mask to index another matrix.
The following code should work:

Mat<> a({1,2,3,4,5,6,7,8,9},3,3);
Mat<bool> b({true, false, true},1,3);
a.i(b);

Copy constructor returns a view

In Python, calling = causes a reference to be made to the matrix, but in C++ it creates a view. This leads to the following code not being translatable to C++:

import numpy as np
a = np.array([1,2,3,4])
b = a
a.shape = (2,2)
print(b.ndim)

of course in C++ there is no way to set the dims member of an existing matrix anyway, but I worry there may be other ways the abstraction leaks.

Refcount incompatible with 32 bit machines

The reference counters on 32 bit machines are typically 32 bits, but we specify 64 bits.

Planned Resolution:
Change the reference counter to 32 bits to be compatible with 32 bit libraries. Cast any incoming 64 bit reference counter pointers to 32 bit and check that the endianness is such that this is okay. Big endian machines will not support wrapping 64bit pointers in the library.

Reported by @mepster

Compound operator on a view doesn't buffer

Performing a compound operation on two matrices with the same backing data results in an error due to lack of buffering.
For example:

Mat<> a({1,2,3,4,5,6},2,3);
a += a.roi(0,1,0,3);
a.print();

This should return:

[[2,4,6]
 [5,6,7]]

But instead returns:

[[2,4,6]
 [6,9,12]]

Missing build directories

A fresh download doesn't install on a clean system anymore. The problem is we added build directories that aren't in the repo, and it screws up make.

Add the empty directories to the repo or have them get generated at build time.

New Memory allocation doesn't work with stack allocation

The refcount being in the Mat header doesn't work because the header can be torn down by the program stack unwinding.
For now, let's see if things work by always dynamically allocating and destructing the base object. If that works, we can strip it down to a simpler base.

print() formatting does not align digits

Matrices containing elements with different numbers of digits are difficult to read due to the single whitespace separating each element. Smarter formatting could be used for better readability.

[]= operator

Python effectively has a [] = operator, implemented by __setitem__, and it is also used in things like foo[bar] += buzz
For things that are a rectangular roi, C++ mostly does what Python does. But as far as I can tell there is no clear way for us to implement

a[a>5] += 7

in C++.

I think we probably need a fancy index object to make this work

CI doesn't work

Make CI able to build the project, so the regression test is useful

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.