Logo white

Peter M. Groen / openbr

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • openbr
  • 3rdparty
  • eigen-3.3.9
  • doc
  • examples
  • Tutorial_ReductionsVisitorsBroadcasti...
  • Opencv4 (#580) ...
    34953f33
    * Make OpenBR compatible with OpenCV 4.X (tested with 4.5.1). There is a loss in functionality with this port. See TODO.md for outstanding issues
    
    * Add ForestInductionTransform back into forest.cpp
    
    * Add boost back in to OpenBR. This was difficult because OpenCV 4 dropped the C persistence layer, which all of the boost classes use. The new 3rdparty/opencv2-compat directory adds the C persistence layer back in, along with the old OpenCV ML classes that were removed for 4.X
    
    * Add boosted forest plugin back in
    
    * Freeing memory only leads to terrible consequences! Both of these cases caused double frees when the pointers were freed. This solution definitely has a memory leak during training, but it does work
    
    * Add InputOutputArray operator
    
    * Properly print matrices with newlines
    
    * Bug fixes
    
    * opencv still defines these
    
    * updated module dependencies
    
    * bump eigen to fix compile error
    
    * opencv ios lib location has changed
    
    * sift now part of features2d
    
    Co-authored-by: Jordan Cheney <jordan@rankone.io>
    Co-authored-by: Scott Klum <scott@rankone.io>
    Co-authored-by: Josh Klontz <josh@rankone.io>
    JordanCheney authored
    2021-03-23 09:21:03 -0600  
    Browse Code ยป
Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp 356 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <iostream>
#include <Eigen/Dense>

using namespace std;
int main()
{
  Eigen::MatrixXf mat(2,4);
  Eigen::VectorXf v(2);
  
  mat << 1, 2, 6, 9,
         3, 1, 7, 2;
         
  v << 0,
       1;
       
  //add v to each column of m
  mat.colwise() += v;
  
  std::cout << "Broadcasting result: " << std::endl;
  std::cout << mat << std::endl;
}