Skip to main content
5 votes
Accepted

A search function that searches for a contact inside a vector

Keeping in mind that it is impossible to give good answers, or a good review, without a clear context of what the code is for or how it is going to be used. A single member function—not even a full ...
indi's user avatar
  • 12k
4 votes
Accepted

imgaussfilt Template Function Implementation for Image in C++

I have strong opinions about the Gaussian filter, don't take this personally. :) First of all, you should know that the Gaussian filter is separable. That is, you can apply a 1D Gaussian filter to the ...
Cris Luengo's user avatar
  • 6,082
4 votes
Accepted

Speed up searching for the lowest element that is not in the array

You present code for a typical "challenge" submission without ever spelling out the problem in the source code. What's more, you miss the opportunity to declare a suggestively named business ...
greybeard's user avatar
  • 6,519
3 votes

convn Template Function Implementation for Image in C++

Continuing G. Sliepen’s answer: Another strange name is level, it indicates which image dimension the loop works over. It has nothing to do with levels. ...
Cris Luengo's user avatar
  • 6,082
3 votes

convn Template Function Implementation for Image in C++

Naming things Toby Speight already pointed out that using x and y for the names of images is confusing, as those names are ...
G. Sliepen's user avatar
  • 58.8k
3 votes

Mongo Queries In C++

Don't use $ in identifiers // I know using $ is an extension. Then you also know it's not standard C++, and it might stop ...
G. Sliepen's user avatar
  • 58.8k
2 votes

Mean by groups Rcpp

Pass by const reference You are passing the NumericVector x by value. This will cause a copy to be made. It is better to pass it ...
G. Sliepen's user avatar
  • 58.8k
2 votes
Accepted

conv3 Template Function Implementation for Image in C++

In this line: auto output = Image<ElementT>( auto is not needed, because you only need to write the type once for a ...
Reinderien's user avatar
  • 62.8k
1 vote
Accepted

Simple Stack and Deque implementation (v2)

I don't know why you need such a stack and deque or why you wouldn't use what STL has or any other opensource library that has implementation of these. Reinventing the wheel for such basic classes isn'...
ALX23z's user avatar
  • 2,391

Only top scored, non community-wiki answers of a minimum length are eligible