文章目录 第一个Cpp例子 #1 环境 #2 概述 #3 开始 #3.1 方法一:Clion #3.2 方法二:手动创建 第一个Cpp例子 #1 环境 macOS 10.15.5 #2 概述 本文通过两种方式创建一个简单的 Cpp工程,对比两种方法的异同,这里不解释各个文件的作用,仅仅只是介绍两种创建Cpp工程的方法 #3 开始 GitHub例子:https://github.com/Coxhuang/FKCpp/tree 运行main.cpp #3.2 方法二:手动创建 创建如下文件 : build CMakeLists.txt main.cpp ? cmake_minimum_required(VERSION 3.16) project(demo) set(CMAKE_CXX_STANDARD 11) add_executable(demo_exe main.cpp ) main.cpp内容如下 : // // Created by Cox on 2020/8/30. // #include <iostream> int main() { std::cout
简单来说,llama.cpp是兼顾兼容与性能的“全能选手”,而BitNet.cpp则是专为“极限压缩”设计的“特种兵”。 的降维打击极致压缩:BitNet.cpp将模型权重压缩至1-bit或1.58-bit(三值:-1,0,1),相比llama.cpp常见的4-bit/8-bit量化,内存占用直接砍掉70%-80%。 速度优势:得益于简化的计算逻辑(主要是加法而非乘法),BitNet.cpp在CPU上的推理速度通常是llama.cpp的2到6倍。 2.兼容性与生态:llama.cpp的全面统治模型自由:如果你需要尝试最新的开源模型(如Llama3,Qwen,DeepSeek等),llama.cpp是绝对首选。 硬件通吃:llama.cpp对GPU(CUDA/Metal/Vulkan)的支持非常成熟,能充分利用显卡加速。相比之下,BitNet.cpp目前主要优化在CPU端,对GPU的支持还在完善中。
YamlCpp #1 环境 macOS 10.15.5 Cmake #2 安装 git clone git@gitee.com:Coxhuang/yaml-cpp.git cd yaml-cpp mkdir -D BUILD_SHARED_LIBS=ON make sudo make install 安装后,库文件和头文件路径: 头文件: /usr/local/include/yaml-cpp 库文件 : /usr/local/lib/libyaml-cpp.a #3 使用 #3.1 Cmake配置文件 cmake_minimum_required(VERSION 3.17) project(yaml_demo ) # 查找yaml-cpp link_directories( ${YAMLCPP_LIBRARY_DIRS} # 添加yaml-cpp库文件路径 ) add_executable(yaml_demo main.cpp) target_link_libraries(yaml_demo ${YAMLCPP_LIBRARIES} # 将yaml-cpp库连接到yaml_demo可执行文件中
#include<iostream>#include<string>#include<algorithm>using namespace std;int main(){ string a,b,c; int length_a,length_b; cin>>a; cin>>b; length_a=a.length(); length_b=b.length(); reverse(a.begin(),a.end()); reverse(b.begin(),b.end(
#endif /*****************************************************************//** * \file GeovinDu.cpp **************************************************************//** * \file ConsoleDuProxyPattern.cpp 2023 *********************************************************************/ // ConsoleDuProxyPattern.cpp
#endif /*****************************************************************//** * \file GeovinDu.cpp ************************************************************//** * \file ConsoleDuMementoPattern.cpp *********************************************************************/ // ConsoleDuMementoPattern.cpp
/*****************************************************************//** * \file GoldEditControl.cpp /*****************************************************************//** * \file GoldRadioButton.cpp /*****************************************************************//** * \file GeovinDu.cpp ***********************************************************//** * \file ConsoleDuMediatorPattern.cpp *********************************************************************/ // ConsoleDuMediatorPattern.cpp
#endif /*****************************************************************//** * \file GeovinDu.cpp **********************************************************//** * \file ConsoleDuCompositePattern.cpp *****************************************************************/ // ConsoleDuCompositePattern.cpp **********************************************************//** * \file ConsoleDuCompositePattern.cpp *****************************************************************/ // ConsoleDuCompositePattern.cpp
Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
mrk it up! #include "SimulatorBase.h" #include "SPlisHSPlasH/Utilities/SceneLoader.h" #include "Utilities/FileSystem.h" #include "SPlisHSPlasH/TimeManager.h" #include "Utilities/PartioReaderWriter.h" #include "SPlisHSPlasH/Emitter.h" #include "SPlisHSPlasH
endif /*****************************************************************//** * \file GoldConfig.cpp 20 May 2023 *********************************************************************/ // GoldConfig.cpp ; namespace DuLazySingletonPattern { GoldConfig* GoldConfig::m_instance = nullptr; //在类外,某个.cpp 20 May 2023 *********************************************************************/ // GoldCommon.cpp 20 May 2023 *********************************************************************/ // GoldFunction.cpp
endif /*****************************************************************//** * \file DuSimple.cpp endif /*****************************************************************//** * \file GoldSimple.cpp #endif /*****************************************************************//** * \file GeovinDu.cpp ********************************************************//** * \file ConsoleDuInterpreterPattern.cpp *******************************************************************/ // ConsoleDuInterpreterPattern.cpp
endif /*****************************************************************//** * \file GeovinDu.cpp ***********************************************************//** * \file ConsoleDuIteratorPattern.cpp *********************************************************************/ // ConsoleDuIteratorPattern.cpp ***********************************************************//** * \file ConsoleDuIteratorPattern.cpp *********************************************************************/ // ConsoleDuIteratorPattern.cpp
/// /// void displayGold(); }; } #endif // GeovinDu.cpp GlobalCreateGold(pMonsterObj); delete pMonsterObj; } } 调用:、 // GeovinDu.cpp
endif /*****************************************************************//** * \file GeovinDu.cpp **********************************************************//** * \file ConsoleDuFlyweightPattern.cpp *******************************************************************/ // ConsoleDuFlyweightPattern.cpp
, string tmpName) :Gold(tmpID, tmpName) { cout << "店铺" << endl; } }; } #endif // GeovinDu.cpp summary> class GeovinDu { private: public: void displaySimple(); }; } #endif // GeovinDu.cpp pplayerobj2; delete pplayerobj3; delete pplayerobj4; } } 调用: // ConsoleDuObserverPattern.cpp // Observer Pattern 观察者模式 // ConsoleDuObserverPattern.cpp : 此文件包含 "ConsoleDuObserverPattern" 类。
#endif /*****************************************************************//** * \file GeovinDu.cpp ************************************************************//** * \file ConsoleDuAdapterPattern.cpp *********************************************************************/ // ConsoleDuAdapterPattern.cpp
#endif /*****************************************************************//** * \file Gold.cpp ****************************************************************//** * \file GoldStatusStateless.cpp /*****************************************************************//** * \file GoldStatusSolid.cpp /*****************************************************************//** * \file GoldStatusSolid.cpp #endif /*****************************************************************//** * \file GeovinDu.cpp
summary>
/// 资源配置 (整合)resource allocation
///
int Presource;
};
}
#endif
// Gold.cpp :
///
#endif /*****************************************************************//** * \file GeovinDu.cpp *************************************************************//** * \file ConsoleDuBridgePattern.cpp 2023 *********************************************************************/ // ConsoleDuBridgePattern.cpp