Код: Выделить всё
Ubuntu Linux 20.04.6 LTS
g++ version 9.4.0
IDE QTCreator
У меня есть следующий код, выполнение которого занимает ~9 мс, но я хотел бы знать, есть ли более эффективный (более быстрый) способ сделать это?
Код: Выделить всё
#include
#include
#include
const uint16_t SET_ROWS{2048};
const uint16_t SET_COLS{1024};
const uint16_t SUBSET_ROWS{1024};
const uint16_t SUBSET_COLS{768};
const uint32_t SET_FOOTPRINT{SET_ROWS*SET_COLS};
const uint32_t SUBSET_FOOTPRINT{SUBSET_ROWS*SUBSET_COLS};
/*
====================== -> SET
| | -> SUBSET |
| | |
|________| |
| |
| |
| |
======================
*/
int main()
{
std::vector subset(SUBSET_FOOTPRINT,1);
std::vector set(SET_FOOTPRINT,0);
std::chrono::time_point start_time;
std::chrono::time_point end_time;
start_time = std::chrono::system_clock::now();
for(int a=0; a
Подробнее здесь: [url]https://stackoverflow.com/questions/79790344/copying-and-padding-a-vectors-rows-quickly[/url]
Мобильная версия