我试图了解用于实习的Fortran代码,但我是一名C ++程序员,但我被困在这段代码中。有人可以启发我吗?
real(kind=kind_real), pointer :: c(:,:,:) (I think this created a pointer to a matrix )
self%c => self%gfld3d(:,:,ioff+1:) (this is in the constructor of the class)
flds%c(ibx,iby,2:flds%nc*flds%nl:2) (this is a function that calls the c variable of the class but I don't understand how the parameters work and what does the colon operator do as a a parameter)
Run Code Online (Sandbox Code Playgroud) 我知道std::priority_queue该类实现了最小堆。有没有办法将其用作最大堆?还是有替代的Maxheap结构?我知道我可以std::make_heap()在std::vectorlambda 上使用该函数来创建自己的Maxheap,但是随后使用诸如std::pop_heap()怪异的函数,并且我认为它们不易于使用。应该有一种更简单的方法,就像我认为的min_heap(priority queue)。
c++ priority-queue standard-library c++-standard-library max-heap